<template>
	<MkDialog ref="dialogRef" title="检验套餐编辑" @submit="closeDialog">
		<MkForm>
			<MkInput v-model="form.id" label="ID" />
			<MkInput v-model="form.code" label="套餐代码" />
			<MkInput v-model="form.name" label="套餐名称" />
			<MkInput v-model="form.price" label="价格" />
			<MkInput v-model="form.hisCode" label="套餐his收费编码" />
			<MkInput v-model="form.type" label="套餐类型" />
			<MkInput v-model="form.group" label="套餐分组" />
			<MkInput v-model="form.paramDesc" label="参数说明" />
			<el-form-item label="审核是否自动签名">
				<el-switch v-model="form.autoSign" size="large" active-text="是" inactive-text="否" />
			</el-form-item>
			<el-form-item label="是否启用">
				<el-switch v-model="form.isEnabled" size="large" active-text="启用" inactive-text="禁用" />
			</el-form-item>
		</MkForm>
	</MkDialog>
</template>
<script lang="ts" setup>
/**
 * 表单数据
 */
const form = ref({
	id: '',
	code: '',
	name: '',
	price: '',
	hisCode: '',
	type: '',
	group: '',
	paramDesc: '',
	autoSign: false,
	isEnabled: false,
});
/**
 * 弹窗逻辑
 */
const dialogRef = ref();
const showDialog = (item: any) => {
	form.value = {
		id: '',
		code: '',
		name: '',
		price: '',
		hisCode: '',
		type: '',
		group: '',
		paramDesc: '',
		autoSign: false,
		isEnabled: false,
	};
	dialogRef.value.show();
};
const closeDialog = () => {
	dialogRef.value.close();
};

defineOptions({
	name: 'EditDialog',
});
defineExpose({ showDialog, closeDialog });
</script>
